home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume89 / librarys / edlib11.2 < prev    next >
Internet Message Format  |  1989-04-26  |  49KB

  1. Path: xanth!ames!oliveb!sun!rishathra!page
  2. From: page%rishathra@Sun.COM (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v89i098:  edlib - library of functions for manx v1.1, Part02/02
  5. Message-ID: <101384@sun.Eng.Sun.COM>
  6. Date: 26 Apr 89 20:46:28 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1453
  9. Approved: page@sun.com
  10.  
  11. Submitted-by: hcrvax!edwin (Edwin Hoogerbeets)
  12. Posting-number: Volume 89, Issue 98
  13. Archive-name: libraries/edlib11.2
  14.  
  15. # This is a shell archive.
  16. # Remove anything above and including the cut line.
  17. # Then run the rest of the file through 'sh'.
  18. # Unpacked files will be owned by you and have default permissions.
  19. #----cut here-----cut here-----cut here-----cut here----#
  20. #!/bin/sh
  21. # shar: SHell ARchive
  22. # Run the following text through 'sh' to create:
  23. #    ed32.lib.uu
  24. #    edlib.h
  25. #    filetype.c
  26. #    getcwd.c
  27. #    getopt.c
  28. #    hextoint.c
  29. #    isbdigit.c
  30. #    iscsym.c
  31. #    iscsymf.c
  32. #    isodigit.c
  33. #    makefile
  34. #    stolower.c
  35. #    stoupper.c
  36. #    strcspn.c
  37. #    strdup.c
  38. #    stricmp.c
  39. #    strnicmp.c
  40. #    strpbrk.c
  41. #    strpos.c
  42. #    strrpbrk.c
  43. #    strrpos.c
  44. #    strspn.c
  45. #    strtod.c
  46. #    strtok.c
  47. #    test.c
  48. #    toint.c
  49. # This is archive 2 of a 2-part kit.
  50. # This archive created: Wed Apr 26 13:37:40 1989
  51. echo "extracting ed32.lib.uu"
  52. sed 's/^X//' << \SHAR_EOF > ed32.lib.uu
  53. X
  54. Xbegin 644 ed32.lib
  55. XM86H````"7V)I;G1O:6YT`$("7V1E8W1O:6YT`(@"7V]P=&5R<@"(`E]O<'1IZ
  56. XM;F0`B`)?;W!T;W!T`(@"7V]P=&%R9P"(`E]G971O<'0`S`-?:&5X=&]I;G0`T
  57. XM#@1?:7-B9&EG:70`4`1?:7-C<WEM`(8$7VES8W-Y;68`LP1?:7-O9&EG:70`D
  58. XMY01?<W1O;&]W97(`&`5?<W1O=7!P97(`2P5?<W1R8W-P;@"!!5]S=')P8G)KN
  59. XM`+T%7W-T<G!O<P#X!5]S=')R<&]S`#4&7W-T<G-P;@!K!E]S=')T;VL`O`9?A
  60. XM=&]I;G0`\P9?8F%S96YA;64`4@=?<W1R:6-M<`"J!U]S=')N:6-M<``'"%]S=
  61. XM=')R<&)R:P!,"%]S=')T;V0`Y@E?<W1R9'5P`"T*7V=E=&-W9`"="U]C:&1I]
  62. XM<@`D#%]F:6QE='EP90``````````````````````````````````````````C
  63. XM`````````````````````````````````````````````````````````````
  64. XM`````````````````````````````````````````````````````````````
  65. XM`````````````````````````````````````````````````````````````
  66. XM`````````````````````````````````````````````````````````````
  67. XM`````````````````````````````````````````````````````````````
  68. XM`````````````````````````````````````````````````````````````
  69. XM`````````````````````````````````````````````````````````````
  70. XM`````````````````````````````````````````````````````````````
  71. XM`````````````````````````````````````````````````````````````
  72. XM`````````````````````````````````````````````````````````````
  73. XM`````````````````````````````````````````````````````````````
  74. XM`````````````````````````````````````````````````````````````
  75. XM`````````````````````````````````````````````````````````````
  76. XM`````````````````````````````````````````````````````````````
  77. XM`````````````````````````````````````````````````````````````
  78. XM`````````````````````````````````````````````````````````````
  79. XM`````````````````````````````````````````````````````````````
  80. XM`````````````````````````````````````````````````````````````
  81. XM`````````````````````````````````````````````````````````````
  82. XM`````````````````````````````````````````````````````````````
  83. XM`````````````````````````````````````````````````````````````
  84. XM`````````````````````````````````````````````````````````````
  85. XM`````````````````````````````````````````````````````````````
  86. XM`````````````````````````````````````````````````````````````
  87. XM`````````````````````````````````````````````````````````````
  88. XM`````````````````````````````````````````````````````````````
  89. XM`````````````````````````````````````````````````````````````
  90. XM`````````````````````````````````````````````````````````````
  91. XM`````````````````````````````````````````````````````````````
  92. XM`````````````````````````````````````````````````````````````
  93. XM`````````````````````````````````````````````````````````````
  94. XM`````````````````````````````````````````````````````````````
  95. XM`````````````````````````````````````````````````````````````
  96. XM`````````````````````````````````````````````````````````````
  97. XM`````````````````````````````````````````````````````````````
  98. XM`````````````````````````````````````````````````````````````
  99. XM`````````````````````````````````````````````````````````````
  100. XM``````````````````````````````!!2F)I;G1O:6YT````4```````````"
  101. XM``0``0`7``D`%@!"P``""```7V)I;G1O:6YT``<(``!?:7-B9&EG:70`!P@`9
  102. XM`%]T;VEN=``'"```+F)E9VEN`````H``4`QB:6YT;VEN="YC`!4,X(8-``C_`
  103. XM`0``'4Y5``!(YP@@)&T`"'@`!'9A;'5E``)L!6YU;6)E<@`&(V/_____$TH2]
  104. XM9SK_&1`22(!(P"\`3KKZ<0`56$]*@&<<_QT@2E**$!!(@$C`+P!.NOIR`!E8\
  105. XM3R($XX$H`-B!_Q%@"O\9(`1,WP003EU.=?\18,+__Q,@!&#R_PT`%0'__P@`>
  106. XM`GML"``!>VP(``![;/4```!!2F1E8W1O:6YT````6`````````````4``0`88
  107. XM``D`%P!&P``""```7V1E8W1O:6YT``<*``!?8W1P7P`'"```7W1O:6YT``<(J
  108. XM```N;75L=0`'"```+F)E9VEN``*``%@,9&5C=&]I;G0N8P`5#."+#0`*_P$`G
  109. XM`!U.50``2.<(("1M``AX``1V86QU90`";`5N=6UB97(`!B-C_____Q-*$F="E
  110. XM_Q<0$DB`2,!!^OHA<0`Q%P@P``((`&<D_QT@2E**$!!(@$C`+P!.NOIR`!E8*
  111. XM3W(*+P`@!$ZZ^G,`%2(?*`'8@/\18`K_&2`$3-\$$$Y=3G7_$6"Z__\3(`1@,
  112. XM\O\-`!<!__\(``)[;`@``'ML"``!6S!C]0``04IG971O<'0``````L`````,,
  113. XM```````*``4`+``)`"<!1,```PH``%]O<'1E<G(``PH`!%]O<'1I;F0`!PH`'
  114. XM!%]O<'1O<'0`!PH`!%]O<'1A<F<``@@``%]G971O<'0`!P@``%]S=')C;7``-
  115. XM!P@``%]S=')C:'(`!P@``%]S=')L96X`!P@``%]W<FET90`'"```+F)E9VENE
  116. XM`````H`"3@.```@"@`).`H`!%`*``?#U$P````'T]1,````!]`QG971O<'0N`
  117. XM8P`5#."0#0`:_P$``!M.5?_^2.<,("@M``CU$P````'T!&-P``8C8P1C``-L$
  118. XM!G-P```!;`5A<F=C``)L`V%R9W8```PC(V,#;W!T<P``$"-C_________Q4,'
  119. XMK0````'0!F$`$69B_Q$@+=`"<0`3L(1M"O\9</],WP0P3EU.=?__$2`MT`)Q/
  120. XM`!_E@"!M``PB<`@`#!$`+6<8_Q$@+=`"<0`14JW0`G$`&>6`(&T`#"MP"`#0]
  121. XMA',`_Q-P`&#,__\12'KZ(6(`,!$@+=`"<0`;Y8`@;0`,+S`(`$ZZ^G4`%5!/O
  122. XM2H!F"/\14JW0`G$`_Q-P_V"H____$2`MT`)Q`!OE@"!M``PB,`@`(&W0`F$`D
  123. XM&Q`P&`!(@$C`*@`K0-""<@#_'[J\````.F<4+P4O+0`03KKZ=@`94$\D0$J`C
  124. XM9@``D/\12JW0`G``$6=:`0`#`F5R<F)U9@#__ELP8Q\;1?_^&WP`"O__(&T`P
  125. XM#"\0$4ZZ^G<`'UA/+P`@;0`,+Q!(>``"3KKZ>``53^\`#$AZ^B%B`%B!$4ZZN
  126. XM^G<`%5A/+P!(>OHA8@`S%4AX``).NOIX`!]/[P`,2'@``DAM__Y(>``"$4ZZ7
  127. XM^G@`$T_O``S_$2`MT`)Q`!OE@"!M``PB,`@`4JW0`F$`$2!MT`)A`!5*,!@`,
  128. XM9@S_$5*MT`)Q`/\5*WP````!T(9A`/__%7`_8`#^X/__&5**#!(`.F8``-+_Y
  129. XM$2`MT`)Q`!OE@"!M``PB<`@`T^W0`F$`%4HI``%G(/\1("W0`G$`$5*MT`)Q*
  130. XM`!OE@"!M``PB,`@`TJW0`F$`$U*!*T'0@G,`$V```)#_$5*MT`)Q`!$@+=`"!
  131. XM<0`3L(1M;O\12JW0`G``$6=:`0`$`F5R<F)U9@#__ELP8Q\;1?_^&WP`"O__!
  132. XM(&T`#"\0$4ZZ^G<`'UA/+P`@;0`,+Q!(>``"3KKZ>``53^\`#$AZ^B%B`%^$L
  133. XM$4ZZ^G<`%5A/+P!(>OHA8@!=@A5(>``"3KKZ>``?3^\`#$AX``)(;?_^2'@`!
  134. XM`A%.NOIX`!-/[P`,_Q4K?`````'0AF$`_Q5P/V``_B3__Q$@+=`"<0`14JW0A
  135. XM`G$`&>6`(&T`#"MP"`#0A',`_Q4K?`````'0AF$`_Q%@+/\1("W0`G$`&^6`C
  136. XM(&T`#"(P"`!2K=`"80`1(&W0`F$`%4HP&`!F#/\5*WP````!T(9A`/\14JW0A
  137. XM`G$`__\10JW0`G,`__\5(`5@`/W4_Q\M+0`Z(&EL;&5G86P@;W!T'VEO;B`MP
  138. XM+2``.B!I;&QE9V$?;"!O<'1I;VX@+2T@`#H@;Q]P=&EO;B!R97%U:7)E<R!A6
  139. XM'VX@87)G=6UE;G0@+2T@`#H?(&]P=&EO;B!R97%U:7)E<Q\@86X@87)G=6UE[
  140. XM;G0@+2T@$0``#0!*`?__"``(>VP(``=[;`@`!'ML"``#(V,(``)L"``!;`@`'
  141. XM`&P(``9[(V,(``5[;/4`````04IH97AT;VEN=````%`````````````$``$`W
  142. XM%@`)`!4`0L```@@``%]H97AT;VEN=``'"@``7V-T<%\`!P@``%]T;VEN=``'+
  143. XM"```+F)E9VEN`````H``4`QH97AT;VEN="YC`!4,X)0-``K_`0``'4Y5``!(1
  144. XMYP@@)&T`"'@`!'9A;'5E``)L!6YU;6)E<@`&(V/_____$TH29SK_%Q`22(!(=
  145. XMP$'Z^B%Q`#$7"#```P@`9QS_'2!*4HH0$$B`2,`O`$ZZ^G(`&5A/(@3I@2@`"
  146. XMV('_$6`*_QD@!$S?!!!.74YU_Q%@PO__$R`$8/+_#0`7`?__"``">VP(``![+
  147. XM;`@``5LP8_4`````04II<V)D:6=I=````"(````````````"``$`$0`)`!``!
  148. XM0L```@@``%]I<V)D:6=I=``'"```+F)E9VEN``````*``"(,:7-B9&EG:70NI
  149. XM8P`5#."9#0`,_P$``!E.50``+P08+0`+!6,``F/__QNX/``Q9P:X/``P9@C_>
  150. XM%W`!*!].74YU__\3<`!@]O__#0`4`?__"```>VP*``L``0`(`!8!7V)P````'
  151. XM(V,!7V)E;F0```0C8P%?8G5F9@``""-C`5]F;&%G<P``#&,!7W5N:70```UC&
  152. XM`5]B>71B=68```YC`5]B=69L96X``!!I`5]T;7!N86UE```2(V,)1DE,10`Z_
  153. XM``'U````04II<V-S>6T``````#X````````````$``$`%@`)`!4`-L```@@`0
  154. XM`%]I<V-S>6T`!P@``%]I<V-S>6UF``<*``!?8W1P7P`'"```+F)E9VEN````[
  155. XM`H``/@QI<V-S>6TN8P`5#."<#0`._P$``!E.50``+P08+0`+!6,``F/__QD0@
  156. XM!$B`2,`O`$ZZ^G$`'5A/2H!F$A`$2(!(P$'Z^B%R`#$7"#```@@`9PS_&Q`$3
  157. XM2(!(P"@?3EU.=?__$W``8/;_#0`6`?__"``!>VP(``![;`@``ELP8_4`04II]
  158. XM<V-S>6UF`````#`````````````#``$`$P`)`!(`+<```@@``%]I<V-S>6UF+
  159. XM``<*``!?8W1P7P`'"```+F)E9VEN`````H``,`QI<V-S>6UF+F,`%0S@GPT`2
  160. XM#?\!```93E4``"\$&"T`"P5C``)C__\7$`1(@$C`0?KZ(7$`,1\2,`@`PCP`Q
  161. XM`V8&N#P`7V8$&W`!8`)P`"@?3EU.=?\-`!$!__\(``![;`@``5LP8_4`04IIJ
  162. XM<V]D:6=I=````#H````````````#``$`$P`)`!(`,L```@@``%]I<V]D:6=IB
  163. XM=``'"@``7V-T<%\`!P@``"YB96=I;@```H``.@QI<V]D:6=I="YC`!4,X*(-Q
  164. XM``W_`0``&4Y5```O!!@M``L%8P`"8___&[@\`#EG!K@\`#AF"/\7<``H'TY=>
  165. XM3G7__Q<0!$B`2,!!^OHA<0`Q'R(`$#`8`$B`2,#`O`````018-[__PT`%@'_-
  166. XM_P@``'ML"``!6S!C]0````!!2G-T;VQO=V5R````,`````````````,``0`4L
  167. XM``D`$P`SP``""```7W-T;VQO=V5R``<(``!?=&]L;W=E<@`'"```+F)E9VENS
  168. XM`````H``,`QS=&]L;W=E<BYC`!4,X*8-``W_`0``'4Y5``!(YP`P)&T`""9*W
  169. XM!'1E;7``!R-C!7-T<@`&(V/_____$6`2_QD0$TB`2,`O`$ZZ^G$`&5A/%H!2%
  170. XMBTH39NK__QD@"DS?#`!.74YU_PT`%@'__P@``7ML"```>R-C]0````!!2G-T?
  171. XM;W5P<&5R````,`````````````,``0`4``D`$P`SP``""```7W-T;W5P<&5R=
  172. XM``<(``!?=&]U<'!E<@`'"```+F)E9VEN`````H``,`QS=&]U<'!E<BYC`!4,Q
  173. XMX*D-``W_`0``'4Y5``!(YP`P)&T`""9*!'1E;7``!R-C!7-T<@`&(V/_____X
  174. XM$6`2_QD0$TB`2,`O`$ZZ^G$`&5A/%H!2BTH39NK__QD@"DS?#`!.74YU_PT`"
  175. XM%@'__P@``7ML"```>R-C]0````!!2G-T<F-S<&X`````.`````````````,`6
  176. XM`0`3``D`$@`VP``""```7W-T<F-S<&X`!P@``%]S=')C:'(`!P@``"YB96=IS
  177. XM;@`"@``X#'-T<F-S<&XN8P`5#."L#0`+_P$``!].50``2.<(,"1M``@F;0`,X
  178. XM$2@*!'1E;7```B-C!7-T<@`&(V,%8VAA<G-E=``'(V/_____'2!$$!!(@$C`8
  179. XM+P`O"TZZ^G$`%5!/2H!F!/\34H1@YO__&R`$D(I,WPP03EU.=?\-`!4!__\(F
  180. XM``%[;`@``'ML]0!!2G-T<G!B<FL`````1@````````````,``0`3``D`$@`\3
  181. XMP``""```7W-T<G!B<FL`!P@``%]I;F1E>``'"```+F)E9VEN```"@`!&#'-TT
  182. XM<G!B<FLN8P`5#."Y#0`)_P$``!].50``2.<(,"1M``@F;0`,!'1E;7```B-CE
  183. XM!7-T<@`&(V,%8VAA<G-E=``'(V/______Q$H"O__'R!$2A!G&B!$$!!(@$C`4
  184. XM+P`3+PM.NOIQ`!503TJ`9@3_$U*$8.#__Q\@1$H09P0@!&`"<`!,WPP0$TY=`
  185. XM3G7_#0`5`?__"``!>R-C"```>R-C]0````!!2G-T<G!O<P``````0```````A
  186. XM``````,``0`3``D`$@`[P``""```7W-T<G!O<P`'"```7W-T<FQE;@`'"```6
  187. XM+F)E9VEN```"@`!`#'-T<G!O<RYC`!4,X+P-``W_`0``'TY5``!(YPP@)&T`"
  188. XM"!@M``\1>@`$8V]U;G1E<@`#;`5S=')I;F<`!B-C!6ME>0`"8_______$TH$1
  189. XM9A#_$R\*3KKZ<0`96$],WP0P3EU.=?__%4HR6`!G$/\7$#)8`+`$9@3_$R`%D
  190. XM8.;_$5*%_Q%@ZO\3</]@WO\-`!P!__\(``%[;`@``'ML]0```$%*<W1R<G!OV
  191. XM<P````!*`````````````P`!`!,`"0`2`#W```((``!?<W1R<G!O<P`'"```!
  192. XM7W-T<FQE;@`'"```+F)E9VEN``*``$H,<W1R<G!O<RYC`!4,X,0-``W_`0``>
  193. XM'TY5``!(YP@P)&T`"!@M``\$=&5M<``'(V,%<W1R:6YG``8C8P5K97D``F/_W
  194. XM_____Q-*!&80_Q,O"DZZ^G$`&5A/3-\,$$Y=3G7__Q,O"DZZ^G$`&5A/T(HF#
  195. XM0%.+8`[_%1`3L`1F!O\;(`N0BF#<4XNWRF3N__\3</]@TO\-`!L!__\(``%[+
  196. XM;`@``'ML]0````!!2G-T<G-P;@``````.`````````````,``0`3``D`$@`VE
  197. XMP``""```7W-T<G-P;@`'"```7VEN9&5X``<(```N8F5G:6X````"@``X#'-T(
  198. XM<G-P;BYC`!4,X,D-``O_`0``'TY5``!(YP@P)&T`""9M``P1*`H$=&5M<``"6
  199. XM(V,%<W1R``8C8P5C:&%R<V5T``<C8_____\=($00$$B`2,`O`"\+3KKZ<0`5*
  200. XM4$]*@&<$_Q-2A&#F__\;(`20BDS?#!!.74YU_PT`%`'__P@``7ML"```>VSU!
  201. XM``!!2G-T<G1O:P``````7@`````````$``0``@`7``D`%0!1P``""```7W-TP
  202. XM<G1O:P`'"```7W-T<G-P;@`'"```7W-T<G!B<FL`!P@``"YB96=I;@`"@`!>P
  203. XM"8````QS=')T;VLN8P`5#.#,#0`,_P$``!].50``2.<,,"1M``@F;0`,!F9RV
  204. XM;VU,87-T5&EM90```2-C!&5N9``#(V,$=&]K96X``B-C!6)U9@`&(V,%<V5P2
  205. XM87)A=&]R<P`'(V/_______\9(`IG!"`*8`0@+=`"80`3*`!G.O\5+PLO!$ZZD
  206. XM^G$`$U!/V(#_%2!$2A!F"O\9<`!,WPPP3EU.=?\5+PLO!$ZZ^G(`'U!/*@!G8
  207. XM!B`%4H!@`G``*T#0@F$`____$R!%0A#__Q,@!_PT`'0'__P@``7ML"``"!
  208. XM>R-C"```>R-C]0!!2G1O:6YT````````8`````````````(``0`0``D`#P`WZ
  209. XMP``""```7W1O:6YT``<(```N8F5G:6X````"@`!@#'1O:6YT+F,`%0S@UPT`K
  210. XM#?\!```93E4``"\$&"T`"P5C``)C__\;N#P`,&T8N#P`.6X2_Q\0!$B`2,"0:
  211. XMO````#`H'TY=$4YU_QNX/`!A;12X/`!F;@[_'1`$2(!(P)"\````5V#@_QNXM
  212. XM/`!!;12X/`!&;@[_'1`$2(!(P)"\````-V#&__\3</]@PO\-`!@!__\(``![E
  213. XM;/4`````04IB87-E;F%M90```#(````````````#``(`%0`)`!,`7\```@@`Y
  214. XM`%]B87-E;F%M90`'"```7W-T<G)P8G)K``<(```N8F5G:6X```*``"X"@``NE
  215. XM#&)A<V5N86UE+F,`%1?=8@T`"/\!```=3E4``$CG`#`D;0`(2'KZ(6$`,!,O!
  216. XM"DZZ^G$`$U!/)D`$9F]O``<C8P5B=68`!B-C_____Q\@"V<&(`M2@&`"(`I,`
  217. XMWPP`$TY=3G7_$SHO```-``X!__\(``%[(V,(``![(V,)5$585`!#"4)/3TP`:
  218. XM:0E50T]53E0`20E#3U5.5`!I"41/54),10!D"49,3T%4`&8)55-(3U)4`$D)A
  219. XM4TA/4E0`:0E#4%12`$P)05!44@`C(T,)4U124%12`"-#"4)95$5"2513`$,)I
  220. XM54)95$4`0PE"651%`&,)5T]21$))5%,`20E55T]21`!)"5=/4D0`:0E,3TY'V
  221. XM0DE44P!,"55,3TY'`$P)3$].1P!L]0````!!2G-T<FEC;7``````K```````K
  222. XM``````,``0`4``D`$P!8P``""```7W-T<FEC;7``!P@``%]T;VQO=V5R``<(`
  223. XM```N8F5G:6X``````H``K`QS=')I8VUP+F,`%0S@KPT`"?\!```?3E4``$CGW
  224. XM"#`D;0`()FT`#!%X``1I;F1E>``";`5S='(Q``8C8P5S='(R``<C8_____\?6
  225. XM2C)(`&<R2C-(`&<L$#)(`!=(@$C`+P!.NOIQ`!]83R\`$#-(`$B`2,`O`$ZZ/
  226. XM^G$`%UA/(A^R@&8$__\34H1@R/__&Q`R2`!(@$C`+P!.NOIQ`!]83R\`$#-(J
  227. XM`$B`2,`O`$ZZ^G$`'UA/(A^R@&P$</]@+A`R2``72(!(P"\`3KKZ<0`?6$\O@
  228. XM`!`S2`!(@$C`+P!.NOIQ`!]83R(?LH!O!'`!8`)P`$S?%0P03EU.=?__#0`56
  229. XM`?__"``!>VP(``![;/4`````04IS=')N:6-M<````+@````````````#``$`*
  230. XM%``)`!,`7<```@@``%]S=')N:6-M<``'"```7W1O;&]W97(`!P@``"YB96=IT
  231. XM;@````*``+@,<W1R;FEC;7`N8P`5#."T#0`)_P$``!].50``2.<,,"1M``@FL
  232. XM;0`,%2@M`!!Z``1I;F1E>``#;`5S='(Q``8C8P5S='(R``<C8P5L96X``FS_A
  233. XM_____Q]*,E@`9SI*,U@`9S0@!%.`'[J`;"P0,E@`2(!(P"\`3KKZ<0`?6$\OI
  234. XM`!`S6`!(@$C`+P!.NOIQ`!=83R(?LH!F!/__$U*%8,#__QL0,E@`2(!(P"\`B
  235. XM3KKZ<0`?6$\O`!`S6`!(@$C`+P!.NOIQ`!]83R(?LH!L!'#_8"X0,E@`%TB`4
  236. XM2,`O`$ZZ^G$`'UA/+P`0,U@`2(!(P"\`3KKZ<0`?6$\B'[*`;P1P`6`"<`!,G
  237. XMWQ4,,$Y=3G7__PT`%@'__P@``7ML"```>VSU````04IS=')R<&)R:P```%8`M
  238. XM```````````$``$`%@`)`!4`1<```@@``%]S=')R<&)R:P`'"```7W-T<FQEY
  239. XM;@`'"```7VEN9&5X``<(```N8F5G:6X``H``5@QS=')R<&)R:RYC`!4,X,`-S
  240. XM``G_`0``'TY5``!(YP@P)&T`""9M``P$=&5M<``"(V,%<W1R``8C8P5C:&%RY
  241. XM<V5T``<C8_______$R\*3KKZ<0`76$_0BB@`4X3__Q\@2E.(L<1G&B!$$!!(.
  242. XM@$C`%2\`+PM.NOIR`!503TJ`9@3_$U.$8-[__Q\@2E.(L<1G!"`$8`)P`$S?L
  243. XM%0P03EU.=?\-`!4!__\(``%[;`@``GLC8P@``'LC8_4`````04IS=')T;V0`C
  244. XM`````R`````````````+``(`*0`)`"<!FL```@@``%]S=')T;V0`!PH``%]C`
  245. XM='!?``<*``!?97)R;F\`!P@``%]T;VEN=``'"```+FUU;'4`!P@``"Y09FQT(
  246. XM``<(```N4&UU;``'"```7W-T<F-M<``'"```7W-P<FEN=&8`!P@``%]A=&]FN
  247. XM``<(```N8F5G:6X``H`"]@*``O8,<W1R=&]D+F,`%1EOP`T`-/\!```73E7_*
  248. XMH$CG"#`"8G5F9F5R`/^@6S!C`F)U9FQI;0#_X"-C`F)U9F]R9P#_Y"-C!&,`-
  249. XM`FP$9'``!R-C!'-P``8C8P)S879E`/_H(V,"97AP=`#_[&P"97-I9VX`__!LQ
  250. XM`F1O='-E96X`__1L`G-C86QE`/_X;`)S:6=N`/_\;`-S='(```@C8P-P='(`=
  251. XM``PC(V/______________Q,D;0`(_Q4,$@`@9@3_$U**8/;__Q<K?`````'_2
  252. XM_/__%0P2`"UF!O\35:W__/\14HK___\30JW_]/\30JW_^/\50>W_H"9(__\7/
  253. XM($M2BQ"\`##_%R!+4HL0O``N__\3*TO_Y/\70>W_T"M(_^#__Q4K2O_H8&;_?
  254. XM_Q>XO````"YF#/__%4JM__1F8O___Q-2K?_T__\38%!!^OHA<0`Q%P@P``)(#
  255. XM`&8"_Q%@3O__%[B\````,&8D__\5M^W_Y&<2____%;?M_^!D"O\5($M2BQ"$O
  256. XM_Q-2K?_X____$6`*_____Q5*K?_T9P3_$U.M__C__Q%@%O___Q6W[?_@9`;_R
  257. XM%2!+4HL0A/___Q5*K?_T9@3_$U*M__C__QM2BA`22(!(P"@`9I#_%;7M_^AFG
  258. XM(O\52JT`#&<(_Q<@;0`,(*T`"/\5*WP````*T(9R`/\;<`!R`$S?#!!.74YUJ
  259. XM____';?M_^1C#`PK`##__V8$_Q-3BV#N__\5M^W_Y&8(_Q<@2U*+$+P`,/__]
  260. XM$4(3______________\3*TK_Z/\30JW_[/\7*WP````!__#___\;($I2BA`0A
  261. XM2(!(P"@`__\?N+P```!E9PJXO````$5F`!$`KO___QL@2E**$!!(@$C`*`#_R
  262. XM_Q>XO````"UF$O\35:W_\/\;($I2BA`02(!(P"@`_Q]@'+B\````*V<(N+P`&
  263. XM```@$68,_QL@2E**$!!(@$C`*`#___\10?KZ(7$`,1<(,``"2`!G7O___Q>X+
  264. XMO````#!F#O\=($I2BA`02(!(P"@`8.K__Q%@*/\3+P1.NOIS`!M83W(*+P`@"
  265. XM+?_L3KKZ=``?(A_2@"M!_^P@2E**$!!(@!5(P"@`0?KZ(7$`,1<(,``"2`!F!
  266. XMS/__%4JM__!L!/\31*W_[/__%R!*4X@K2/_H_____Q5*K0`,9PC_%R!M``P@I
  267. XMK?_H__\7("W_^-&M_^S___\5*WP````)T(9R`/__&0RM```!-?_L;QS_%2`M]
  268. XM__Q.NOIU`!TD/'_O__\F//___U5.NOIV`!-@`/ZZ_QD,K0```37_[&8P_Q%(2
  269. XM>OHA80`P%2\M_^1.NOIW`!503TJ`;QS_%2`M__Q.NOIU`!TD/'_O__\F//__8
  270. XM_U5.NOIV`!-@`/Z"_QM@3@RM___^O?_L;!3_%2`M__Q.NOIU`!5T`'8`3KKZX
  271. XM=@`38`#^8O\9#*W___Z]_^QF)O\12'KZ(6$`4H$5+RW_Y$ZZ^G<`%5!/2H!LB
  272. XM%/\5("W__$ZZ^G4`%70`=@!.NOIV`!-@`/XR______\5+RW_[$AZ^B%A`%6"M
  273. XM$R\+3KKZ>``33^\`#/\10JW0`G(`_Q5(;?^@3KKZ>0`;6$\O`2\`("W__$ZZ[
  274. XM^G4`&20`)@$@'R(?3KKZ=@`38`#]]O\?,3<Y-S8Y,S$S-#@V,C,Q-!\W`#0Y<
  275. XM-#`V-38T-3@T,3(T&38U-#0`925D```-`-(!__\(``A[;`@`!WML"``";`@`4
  276. XM`5LP8P@``'MD"``#>VP)5$585`!#"4)/3TP`:0E50T]53E0`20E#3U5.5`!IB
  277. XM"41/54),10!D"49,3T%4`&8)55-(3U)4`$D)4TA/4E0`:0E#4%12`$P)05!4"
  278. XM4@`C(T,)4U124%12`"-#"4)95$5"2513`$,)54)95$4`0PE"651%`&,)5T]2A
  279. XM1$))5%,`20E55T]21`!)"5=/4D0`:0E,3TY'0DE44P!,"55,3TY'`$P)3$].3
  280. XM1P!L"``)>V3U``!!2G-T<F1U<```````1@````````````8``0`<``D`&P!'9
  281. XMP``""```7W-T<F1U<``'"```7W-T<FQE;@`'"```7VUA;&QO8P`'"@``7V5R^
  282. XM<FYO``<(``!?<W1R8V%T``<(```N8F5G:6X````"@`!&#'-T<F1U<"YC`!49%
  283. XM;E\-``O_`0``'TY5``!(YP`P)&T`""\*3KKZ<0`56$\O`$ZZ^G(`$UA/)D`$.
  284. XM9'5P``<C8P5S='(`!B-C_____Q,@"V82_Q4K?`````/0AG,`_QEP`$S?#`!.&
  285. XM74YU____$R`+9PK_%2\*+PM.NOIT`!%03____Q,@"V#F_PT`&P'__P@`!'ML3
  286. XM"``!>VP(``![(V,(``)[(V,(``-L]0```$%*9V5T8W=D``````&<````````6
  287. XM````#@`%`#D`"0`T`7#```((``!?9V5T8W=D``<(``!?;6%L;&]C``<*``!?W
  288. XM97)R;F\`!P@``%],;V-K``<(``!?9G)E90`'"```7U5N3&]C:P`'"```7T%L"
  289. XM;&]C365M``<(``!?4&%R96YT1&ER``<(``!?1G)E94UE;0`'"```7T5X86UI%
  290. XM;F4`!P@``%]S=')L96X`!P@``%]S=')C870``@``B%]F;VQL;W<`!P@``"YBS
  291. XM96=I;@`````"@`"&`H``A@*``9@"@`&&`H`!F`QG971C=V0N8P`5&2:'#0`2'
  292. XM_P$``!E.50``2.<(('@`!&UA;&QO8V5D``)L"D9I;&5,;V-K``1L;V-K``8CG
  293. XM.@`!`V)U9@``""-C`W-I>F4```QL________%4JM``AF)/\5+RT`#$ZZ^G$`&
  294. XM%UA/*T``"&82_Q4K?`````/0AG(`_QEP`$S?!!!.74YU__\1>`'_____%4AX]
  295. XM__Y(>OHA80`P$4ZZ^G,`$U!/)$#__Q4@;0`(0A#__Q\O+0`,+RT`""\*83)/%
  296. XM[P`,$TJ`9AK__Q-*A&<*_Q4O+0`(3KKZ=``16$____\3+PI.NOIU`!%83___$
  297. XM$W``8++___\3+PI.NOIU`!%83___%2`M``A@I/\1```-`#;_`0`"%TY5``!(0
  298. XMYP@P!&YE=VQO8VL`!R,Z``$*1FEL94EN9F]";&]C:P`*1&%T95-T86UP``L`4
  299. XM`P`#``P!9'-?1&%Y<P```&P!9'-?36EN=71E```$;`%D<U]4:6-K```(;`L`@
  300. XM`@`*`00!9FEB7T1I<VM+97D```!L`69I8E]$:7)%;G1R>51Y<&4```1L`69IF
  301. XM8E]&:6QE3F%M90``"%LP8P%F:6)?4')O=&5C=&EO;@``=&P!9FEB7T5N=')YS
  302. XM5'EP90``>&P!9FEB7U-I>F4``'QL`69I8E].=6U";&]C:W,``(!L`69I8E]$Z
  303. XM871E``"$.@`#`69I8E]#;VUM96YT``"06S!C`7!A9&1I;F<``.!;,&,$9FEBX
  304. XM``8C.@`"`VQO8VL```@C.@`!`V)U9@``#"-C`W-I>F4``!!L__________\50
  305. XM2JT`"&8*_QEP`4S?#!!.74YU____&TAY``$``$AX`01.NOIV`!-03R1`__\3K
  306. XM(`IF!/\3<`!@WO__%2\M``A.NOIW`!-83R9`__\?+RT`$"\M``PO"V&V3^\`D
  307. XM#!-*@&80_Q=(>`$$+PI.NOIX`!%03_\3<`!@KO___Q<O"B\M``A.NOIY`!=0`
  308. XM3TJ`9P``C`$``P1C``)C____%2\M``Q.NOIZ`!M83R\`($I0B"\(3KKZ>@`=5
  309. XM6$\B']*`5(&RK0`0;Q+_%TAX`00O"DZZ^G@`$5!/_Q5P`&``_VC___\9(`MGP
  310. XM+B\M``Q.NOIZ`!]83R!`T>T`#!@H__^X/``Z%V<4N#P`+V<._Q%(>OHA9``P9
  311. XM%2\M``Q.NOI[`!%03____QL@2E"(+P@O+0`,3KKZ>P`14$___Q,@"V8._Q%(8
  312. XM>OHA9``R%2\M``Q.NOI[`!%03_____\72'@!!"\*3KKZ>``14$___Q5P`6``T
  313. XM_P+_$R\`.@`-`&8!__\(``M[;`@`"GML"``)>VP(``A[;`@`!7ML"``$>VP'^
  314. XM9F]L;&]W```,>VP(``-[(SH``0@`!WLC.@`!"``&>R,Z``((``%[(V,(``)LZ
  315. XM"4)35%(`;`E"4%12`&P(``![(V,)5$585`!#"4)/3TP`:0E50T]53E0`20E#1
  316. XM3U5.5`!I"41/54),10!D"49,3T%4`&8)55-(3U)4`$D)4TA/4E0`:0E#4%12W
  317. XM`$P)05!44@`C(T,)4U124%12`"-#"4)95$5"2513`$,)54)95$4`0PE"651%W
  318. XM`&,)5T]21$))5%,`20E55T]21`!)"5=/4D0`:0E,3TY'0DE44P!,"55,3TY'Y
  319. XM`$P)3$].1P!L]0``04IC:&1I<@```````&@````````````&``$`'0`)`!P`L
  320. XMA\```@@``%]C:&1I<@`'"@``7V5R<FYO``<(``!?9FEL971Y<&4`!P@``%],:
  321. XM;V-K``<(``!?0W5R<F5N=$1I<@`'"```+F)E9VEN``````*``&@,8VAD:7(N=
  322. XM8P`5&5.2#0`-_P$``!-.5?_\"D9I;&5,;V-K``)L;V-K`/_\(SH``0-P871H(
  323. XM```((V/_____%4JM``AF#O\5*WP````+T(9Q`/\5</].74YU____%2\M``A.4
  324. XMNOIR`!E83["\`````6<,_Q4K?`````'0AG$`_Q-P_V#>____&4AX__XO+0`(_
  325. XM3KKZ<P`74$\K0/_\9@S_%2M\````"-"&<0#_$W#_8+[___\5+RW__$ZZ^G0`+
  326. XM%5A/*T#__/__$W``8*S_#0`D`?__"``$>R,Z``$(``-[(SH``0@``6P)0E-4.
  327. XM4@!L"4)05%(`;`@``GML"```>VP)5$585`!#"4)/3TP`:0E50T]53E0`20E#V
  328. XM3U5.5`!I"41/54),10!D"49,3T%4`&8)55-(3U)4`$D)4TA/4E0`:0E#4%12W
  329. XM`$P)05!44@`C(T,)4U124%12`"-#"4)95$5"2513`$,)54)95$4`0PE"651%W
  330. XM`&,)5T]21$))5%,`20E55T]21`!)"5=/4D0`:0E,3TY'0DE44P!,"55,3TY'Y
  331. XM`$P)3$].1P!L]0``04IF:6QE='EP90```(`````````````(``$`(P`)`"(`J
  332. XMV\```@@``%]F:6QE='EP90`'"```7T%L;&]C365M``<*``!?97)R;F\`!P@`#
  333. XM`%],;V-K``<(``!?17AA;6EN90`'"```7U5N3&]C:P`'"```7T9R965-96T`F
  334. XM!P@``"YB96=I;@````*``(`,9FEL971Y<&4N8P`5&6.1#0`0_P$``!=.50``\
  335. XM2.<(,`1R97-U;'0``FP*1FEL94QO8VL`!&QO8VL`!R,Z``$*1FEL94EN9F]"U
  336. XM;&]C:P`*1&%T95-T86UP``L``P`#``P!9'-?1&%Y<P```&P!9'-?36EN=71EP
  337. XM```$;`%D<U]4:6-K```(;`L``@`*`00!9FEB7T1I<VM+97D```!L`69I8E]$(
  338. XM:7)%;G1R>51Y<&4```1L`69I8E]&:6QE3F%M90``"%LP8P%F:6)?4')O=&5C%
  339. XM=&EO;@``=&P!9FEB7T5N=')Y5'EP90``>&P!9FEB7U-I>F4``'QL`69I8E].V
  340. XM=6U";&]C:W,``(!L`69I8E]$871E``"$.@`#`69I8E]#;VUM96YT``"06S!C>
  341. XM`7!A9&1I;F<``.!;,&,$9FEB``8C.@`"`W!A=&@```@C8_________\;2'D`3
  342. XM`0``2'@!!$ZZ^G$`%U!/)$!*@&82_Q4K?`````/0AG(`_QEP_TS?#!!.74YU7
  343. XM____&4AX__XO+0`(3KKZ<P`74$\F0$J`9@S_%2M\````"-"&<@#_$W#_8-C_'
  344. XM__\5+PHO"TZZ^G0`$5!/__\=2JH`!&\$<`%@`G`"*`#__Q,O"TZZ^G4`$5A/9
  345. XM_Q=(>`$$+PI.NOIV`!%03___$R`$8*C_#0`M`?__"``&>VP(``5[;`@`!'ML-
  346. XM"``#>R,Z``$(``%[(SH``@@``FP)0E-44@!L"4)05%(`;`@``'ML"51%6%0`7
  347. XM0PE"3T],`&D)54-/54Y4`$D)0T]53E0`:0E$3U5"3$4`9`E&3$]!5`!F"553*
  348. XM2$]25`!)"5-(3U)4`&D)0U!44@!,"4%05%(`(R-#"5-44E!44@`C0PE"651%Z
  349. XM0DE44P!#"55"651%`$,)0EE410!C"5=/4D1"2513`$D)55=/4D0`20E73U)$2
  350. XA`&D)3$].1T))5%,`3`E53$].1P!,"4Q/3D<`;/4`````4
  351. X``
  352. Xend
  353. Xsize 13308
  354. SHAR_EOF
  355. echo "extracting edlib.h"
  356. sed 's/^X//' << \SHAR_EOF > edlib.h
  357. X/*
  358. X *  edlib.h v1.1 Copyright 1989 Edwin Hoogerbeets
  359. X *
  360. X *  This code may be freely redistributed as long as no cost is levied
  361. X *  for it and that this copyright notice remains intact.
  362. X *
  363. X *  edlib contains a bunch of routines that are listed in H&S that are
  364. X *  not in the Manx libraries. Also contains other public domain as well
  365. X *  as freely redistributable routines.
  366. X *
  367. X *  The library was compiled with Manx 3.6a.
  368. X */
  369. X#include <exec/types.h>
  370. X#define EFAULT 11         /* for chdir */
  371. X#define TYPE_DIR  1       /* for filetype */
  372. X#define TYPE_FILE 2
  373. X#define isdir(a)          (filetype(a) == TYPE_DIR)
  374. X#define isfile(a)         (filetype(a) == TYPE_FILE)
  375. X#define MDMINEXPT         -323
  376. X#define MDMINFRAC         "494065645841246544"
  377. X#define ZERO              0.0
  378. X#define MDMAXEXPT         309
  379. X#define MDMAXFRAC         "17976931348623147"
  380. X#define HUGE              1.7976931348623147e308
  381. X
  382. X/* character processing functions */
  383. Xextern int   isbdigit();  /* is the character a `1' or a `0'? */
  384. Xextern int   iscsym();    /* character part of a valid C symbol? */
  385. Xextern int   iscsymf();   /* character valid a first char in a C symbol? */
  386. Xextern int   toint();     /* converts a character 0..f to its hexadecimal value */
  387. Xextern int   isodigit();  /* is this an octal digit? */
  388. X
  389. X/* string processing functions */
  390. Xextern char *basename();  /* find the file name in a full path name */
  391. Xextern int  bintoint();   /* these three take character strings and return the */
  392. Xextern int  dectoint();   /* int value of the number in the string */
  393. Xextern int  hextoint();
  394. Xextern char *stoupper();  /* converts a string to entirely upper case chars */
  395. Xextern char *stolower();  /* converts a string to entirely lower case chars */
  396. Xextern int  strpos();     /* gives position of first occurance of char in string */
  397. Xextern int  strrpos();    /* gives position of last occurance of char in string */
  398. Xextern char *strrpbrk();
  399. Xextern int  stricmp();    /* case insensitive string compare */
  400. Xextern int  strnicmp();   /* " with a certain length */
  401. Xextern int  strcspn();
  402. Xextern char *strpbrk();   /* these four courtesy Daniel J. Barrett */
  403. Xextern char *strtok();
  404. Xextern int  strspn();
  405. Xextern double strtod();   /* convert a string to a double */
  406. Xextern char *strdup();    /* return a duplicate of a string */
  407. X
  408. X/* other functions */
  409. Xextern int  chdir();      /* change directory to given path */
  410. Xextern char *getcwd();    /* get current working directory */
  411. Xextern int  filetype();   /* return whether name is dir or file */
  412. X
  413. X/* definitions to use getopt() */
  414. Xextern int getopt();
  415. Xextern char *optarg;
  416. Xextern int optind;
  417. X
  418. X
  419. X
  420. X
  421. SHAR_EOF
  422. echo "extracting filetype.c"
  423. sed 's/^X//' << \SHAR_EOF > filetype.c
  424. X/*
  425. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  426. X * This code is freely redistributable as long as no charge other than
  427. X * reasonable copying fees are levied for it.
  428. X */
  429. X#include "edlib.h"
  430. X#include <libraries/dos.h>
  431. X#include <exec/memory.h>
  432. X#include <errno.h>
  433. X
  434. X#define FIBSIZE sizeof(struct FileInfoBlock)
  435. X
  436. Xextern struct FileInfoBlock *AllocMem();
  437. Xextern struct FileLock      *Lock();
  438. X
  439. Xint filetype(path)
  440. Xchar *path;
  441. X{
  442. X  register struct FileInfoBlock *fib;
  443. X  register struct FileLock *lock;
  444. X  register int result;
  445. X
  446. X
  447. X  if ( !(fib = AllocMem(FIBSIZE,MEMF_CLEAR)) ) {
  448. X    errno = ENOMEM;
  449. X    return(-1);
  450. X  }
  451. X
  452. X  if ( !(lock = Lock(path,ACCESS_READ)) ) {
  453. X    errno = EACCES;
  454. X    return(-1);
  455. X  }
  456. X
  457. X  Examine(lock,fib);
  458. X
  459. X  result = ( fib->fib_DirEntryType > 0 ) ? TYPE_DIR : TYPE_FILE;
  460. X
  461. X  UnLock(lock);
  462. X  FreeMem(fib,FIBSIZE);
  463. X
  464. X  return(result);
  465. X}
  466. X
  467. X
  468. X
  469. SHAR_EOF
  470. echo "extracting getcwd.c"
  471. sed 's/^X//' << \SHAR_EOF > getcwd.c
  472. X/*
  473. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  474. X * This code is freely redistributable as long as no charge other than
  475. X * reasonable copying fees are levied for it.
  476. X */
  477. X#include "edlib.h"
  478. X#include <libraries/dos.h>
  479. X#include <exec/memory.h>
  480. X#include <errno.h>
  481. X
  482. X#define NULL                0L
  483. X#define FIBSIZE             sizeof(struct FileInfoBlock)
  484. Xextern char                 *malloc();
  485. Xextern struct FileInfoBlock *AllocMem();
  486. Xextern struct FileLock      *ParentDir();
  487. Xextern struct FileLock      *Lock();
  488. X
  489. Xchar *getcwd(buf,size)
  490. Xchar *buf;
  491. Xint size;
  492. X{
  493. X  register struct FileLock *lock;
  494. X  register int malloced = 0;
  495. X
  496. X  if ( !buf ) {
  497. X    if ( !(buf = malloc(size)) ) {
  498. X      errno = ENOMEM;
  499. X      return(NULL);
  500. X    }
  501. X    malloced = 1;
  502. X  }
  503. X
  504. X  /* get a lock on the current working directory */
  505. X  lock = Lock("",ACCESS_READ);
  506. X
  507. X  buf[0] = '\0';
  508. X
  509. X  if ( !follow(lock,buf,size) ) {
  510. X
  511. X    if ( malloced ) {
  512. X      free(buf);
  513. X    }
  514. X
  515. X    UnLock(lock);
  516. X
  517. X    return(NULL);
  518. X  }
  519. X
  520. X  UnLock(lock);
  521. X
  522. X  return(buf);
  523. X}
  524. X
  525. Xstatic int follow(lock,buf,size)
  526. Xstruct FileLock *lock;
  527. Xchar *buf;
  528. Xint size;
  529. X{
  530. X  register struct FileInfoBlock *fib;
  531. X  register struct FileLock *newlock;
  532. X
  533. X  /* at end of road */
  534. X  if ( !lock ) {
  535. X    return(1);
  536. X  }
  537. X
  538. X  fib = AllocMem(FIBSIZE,MEMF_CLEAR);
  539. X
  540. X  if ( !fib )
  541. X    return(0);
  542. X
  543. X  newlock = ParentDir(lock);
  544. X
  545. X  if ( !follow(newlock,buf,size) ) {
  546. X    FreeMem(fib,FIBSIZE);
  547. X    return(0);
  548. X  }
  549. X
  550. X  if ( Examine(lock,fib) ) {
  551. X    register char c;
  552. X
  553. X    if ( strlen(buf) + strlen(fib->fib_FileName) + 2 > size ) {
  554. X      FreeMem(fib,FIBSIZE);
  555. X      return(0);
  556. X    }
  557. X
  558. X    if ( newlock && (c = buf[strlen(buf)-1]) != ':' && c != '/' ) {
  559. X      strcat(buf,"/");
  560. X    }
  561. X
  562. X    strcat(buf,&fib->fib_FileName[0]);
  563. X
  564. X    if ( !newlock) {
  565. X      strcat(buf,":");
  566. X    }
  567. X  }
  568. X
  569. X  FreeMem(fib,FIBSIZE);
  570. X
  571. X  return(1);
  572. X}
  573. X
  574. SHAR_EOF
  575. echo "extracting getopt.c"
  576. sed 's/^X//' << \SHAR_EOF > getopt.c
  577. X/*
  578. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  579. X * This code is freely redistributable as long as no charge other than
  580. X * reasonable copying fees are levied for it.
  581. X */
  582. X
  583. X#define NULL    0
  584. X#define EOF     (-1)
  585. X#define ERR(s, c)       if(opterr){\
  586. X        extern int strlen(), write();\
  587. X        char errbuf[2];\
  588. X        errbuf[0] = c; errbuf[1] = '\n';\
  589. X        (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
  590. X        (void) write(2, s, (unsigned)strlen(s));\
  591. X        (void) write(2, errbuf, 2);}
  592. X
  593. Xextern int strcmp();
  594. Xextern char *strchr();
  595. X
  596. Xint     opterr = 1;
  597. Xint     optind = 1;
  598. Xint     optopt;
  599. Xchar    *optarg;
  600. X
  601. Xint
  602. Xgetopt(argc, argv, opts)
  603. Xregister int     argc;
  604. Xchar    **argv, *opts;
  605. X{
  606. X        static int sp = 1;
  607. X        register int c;
  608. X        register char *cp;
  609. X
  610. X        if(sp == 1)
  611. X                if(optind >= argc)
  612. X                        return(EOF);
  613. X                else {
  614. X                    if(argv[optind][0] != '-') {
  615. X                        optarg = argv[optind++];
  616. X                        return(NULL);
  617. X                    }
  618. X                    if(strcmp(argv[optind], "--") == NULL) {
  619. X                        optind++;
  620. X                        return(EOF);
  621. X                    }
  622. X                }
  623. X        optopt = c = argv[optind][sp];
  624. X        if(c == ':' || (cp=strchr(opts, c)) == NULL) {
  625. X                ERR(": illegal option -- ", c);
  626. X                if(argv[optind][++sp] == '\0') {
  627. X                        optind++;
  628. X                        sp = 1;
  629. X                }
  630. X                return('?');
  631. X        }
  632. X        if(*++cp == ':') {
  633. X                if(argv[optind][sp+1] != '\0')
  634. X                        optarg = &argv[optind++][sp+1];
  635. X                else if(++optind >= argc) {
  636. X                        ERR(": option requires an argument -- ", c);
  637. X                        sp = 1;
  638. X                        return('?');
  639. X                } else
  640. X                        optarg = argv[optind++];
  641. X                sp = 1;
  642. X        } else {
  643. X                if(argv[optind][++sp] == '\0') {
  644. X                        sp = 1;
  645. X                        optind++;
  646. X                }
  647. X                optarg = NULL;
  648. X        }
  649. X        return(c);
  650. X}
  651. SHAR_EOF
  652. echo "extracting hextoint.c"
  653. sed 's/^X//' << \SHAR_EOF > hextoint.c
  654. X/*
  655. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  656. X * This code is freely redistributable as long as no charge other than
  657. X * reasonable copying fees are levied for it.
  658. X */
  659. X
  660. X/* this function takes a string of hex digits and returns its value */
  661. X#include <ctype.h>
  662. X
  663. Xint hextoint(number)
  664. Xregister char *number;
  665. X{
  666. X    register int value = 0;
  667. X
  668. X    while ( *number )
  669. X        if ( isxdigit(*number) ) {
  670. X            value = ( value << 4 )  + toint(*number++);
  671. X        } else {
  672. X            return(value);
  673. X        }
  674. X
  675. X    return(value);
  676. X}
  677. SHAR_EOF
  678. echo "extracting isbdigit.c"
  679. sed 's/^X//' << \SHAR_EOF > isbdigit.c
  680. X/*
  681. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  682. X * This code is freely redistributable as long as no charge other than
  683. X * reasonable copying fees are levied for it.
  684. X */
  685. X
  686. X/*
  687. X    tests whether the given character could be a binary digit
  688. X*/
  689. X#include <stdio.h>
  690. X
  691. Xint isbdigit(c)
  692. Xregister char c;
  693. X{
  694. X    if ( c == '1' || c == '0' ) {
  695. X        return(1);
  696. X    } else {
  697. X        return(NULL);
  698. X    }
  699. X}
  700. SHAR_EOF
  701. echo "extracting iscsym.c"
  702. sed 's/^X//' << \SHAR_EOF > iscsym.c
  703. X/*
  704. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  705. X * This code is freely redistributable as long as no charge other than
  706. X * reasonable copying fees are levied for it.
  707. X */
  708. X
  709. X/*
  710. X    this function returns a non-zero number if the character given
  711. X    is suitable for the a character of an identifier
  712. X*/
  713. X#include <ctype.h>
  714. X#define NULL 0
  715. X
  716. Xint iscsym(c)
  717. Xregister char c;
  718. X{
  719. X    if ( iscsymf(c) || isdigit(c) )
  720. X        return(c);
  721. X
  722. X    return(NULL);
  723. X}
  724. X
  725. SHAR_EOF
  726. echo "extracting iscsymf.c"
  727. sed 's/^X//' << \SHAR_EOF > iscsymf.c
  728. X/*
  729. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  730. X * This code is freely redistributable as long as no charge other than
  731. X * reasonable copying fees are levied for it.
  732. X */
  733. X
  734. X/*
  735. X    iscsymf is included here because Manx for some reason does not have
  736. X    it in ctype.h. tells whether or not the given character may be the
  737. X    first character of a valid C symbol
  738. X*/
  739. X#include <ctype.h>
  740. Xint iscsymf(c)
  741. Xregister char c;
  742. X{
  743. X    return( isalpha(c) || c == '_' );
  744. X}
  745. SHAR_EOF
  746. echo "extracting isodigit.c"
  747. sed 's/^X//' << \SHAR_EOF > isodigit.c
  748. X/*
  749. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  750. X * This code is freely redistributable as long as no charge other than
  751. X * reasonable copying fees are levied for it.
  752. X */
  753. X
  754. X/*
  755. X    returns a nonzero value if c is the code for an octal digit, otherwise
  756. X    return zero
  757. X*/
  758. X#include <ctype.h>
  759. X
  760. Xint isodigit(c)
  761. Xregister char c;
  762. X{
  763. X    if (c == '9' || c == '8') {
  764. X        return(0);
  765. X    } else {
  766. X        return(isdigit(c));
  767. X    }
  768. X}
  769. X
  770. SHAR_EOF
  771. echo "extracting makefile"
  772. sed 's/^X//' << \SHAR_EOF > makefile
  773. X#
  774. X# makefile for the edlib library source directory
  775. X# Copyright 1989 Edwin Hoogerbeets
  776. X#
  777. X# make sure that lb is in your path or make will give you an exec failure
  778. X#
  779. X
  780. X#
  781. X# add +L to compile ed32.lib, and leave blank for ed.lib
  782. X#
  783. XCFLAGS=+L +fi
  784. X
  785. XOBJS= bintoint.o dectoint.o getopt.o hextoint.o isbdigit.o \
  786. X      iscsym.o iscsymf.o isodigit.o stolower.o stoupper.o \
  787. X      strcspn.o strpbrk.o strpos.o strrpos.o strspn.o \
  788. X      strtok.o toint.o basename.o stricmp.o strnicmp.o \
  789. X      strrpbrk.o strtod.o strdup.o getcwd.o chdir.o \
  790. X      filetype.o
  791. X
  792. Xtest32: test.o ed32.lib
  793. X        ln test.o -led32 -lma32 -lc32 -o test32
  794. X
  795. Xtest: test.o ed.lib
  796. X        ln test.o -led -lma -lc -o test
  797. X
  798. Xed32.lib: $(OBJS)
  799. X        lb ed32.lib $(OBJS)
  800. X
  801. Xed.lib: $(OBJS)
  802. X        lb ed.lib $(OBJS)
  803. X
  804. Xclean:
  805. X        -shell -c "rm $(OBJS)"
  806. X
  807. SHAR_EOF
  808. echo "extracting stolower.c"
  809. sed 's/^X//' << \SHAR_EOF > stolower.c
  810. X/*
  811. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  812. X * This code is freely redistributable as long as no charge other than
  813. X * reasonable copying fees are levied for it.
  814. X */
  815. X
  816. X/*
  817. X    string to lower changes all upper case letters in a string to lower
  818. X    case.
  819. X*/
  820. X#include <ctype.h>
  821. X
  822. Xchar *stolower(str)
  823. Xregister char *str;
  824. X{
  825. X    register char *temp = str;
  826. X
  827. X    for ( ; *temp ; temp++ )
  828. X        *temp = (char) tolower(*temp);
  829. X
  830. X    return(str);
  831. X}
  832. SHAR_EOF
  833. echo "extracting stoupper.c"
  834. sed 's/^X//' << \SHAR_EOF > stoupper.c
  835. X/*
  836. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  837. X * This code is freely redistributable as long as no charge other than
  838. X * reasonable copying fees are levied for it.
  839. X */
  840. X
  841. X/*
  842. X    string to upper changes all lower case letters in a string to upper
  843. X    case.
  844. X*/
  845. X#include <ctype.h>
  846. X
  847. Xchar *stoupper(str)
  848. Xregister char *str;
  849. X{
  850. X    register char *temp = str;
  851. X
  852. X    for ( ; *temp ; temp++ )
  853. X        *temp = (char) toupper(*temp);
  854. X
  855. X    return(str);
  856. X}
  857. SHAR_EOF
  858. echo "extracting strcspn.c"
  859. sed 's/^X//' << \SHAR_EOF > strcspn.c
  860. X/*
  861. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  862. X * This code is freely redistributable as long as no charge other than
  863. X * reasonable copying fees are levied for it.
  864. X */
  865. X
  866. X/* Return the number of characters NOT from "charset" that are at the
  867. X * BEGINNING of string "string".
  868. X*/
  869. X
  870. Xint strcspn(str, charset)
  871. Xregister char *str, *charset;
  872. X{
  873. X        register char *temp = str;
  874. X
  875. X        while (!strchr(charset, *temp))
  876. X                ++temp;
  877. X
  878. X        return(temp - str);
  879. X}
  880. X
  881. SHAR_EOF
  882. echo "extracting strdup.c"
  883. sed 's/^X//' << \SHAR_EOF > strdup.c
  884. X/*
  885. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  886. X * This code is freely redistributable as long as no charge other than
  887. X * reasonable copying fees are levied for it.
  888. X */
  889. X#include <errno.h>
  890. X
  891. X#define NULL 0L
  892. Xextern char *malloc();
  893. X
  894. Xchar *strdup(str)
  895. Xregister char *str;
  896. X{
  897. X  register char *dup = malloc(strlen(str));
  898. X
  899. X  if ( !dup ) {
  900. X    errno = ENOMEM;
  901. X    return(NULL);
  902. X  }
  903. X
  904. X  if ( dup ) {
  905. X    strcat(dup,str);
  906. X  }
  907. X
  908. X  return(dup);
  909. X}
  910. X
  911. SHAR_EOF
  912. echo "extracting stricmp.c"
  913. sed 's/^X//' << \SHAR_EOF > stricmp.c
  914. X/*
  915. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  916. X * This code is freely redistributable as long as no charge other than
  917. X * reasonable copying fees are levied for it.
  918. X */
  919. X
  920. X#include <ctype.h>
  921. X
  922. Xint stricmp(str1,str2)
  923. Xregister char *str1,*str2;
  924. X{
  925. X    register int index = 0;
  926. X
  927. X    while ( str1[index] && str2[index] &&
  928. X            tolower(str1[index]) == tolower(str2[index]) )
  929. X        ++index;
  930. X
  931. X    return( (tolower(str1[index]) < tolower(str2[index])) ? -1 :
  932. X          ( (tolower(str1[index]) > tolower(str2[index])) ?  1 : 0) );
  933. X}
  934. X
  935. SHAR_EOF
  936. echo "extracting strnicmp.c"
  937. sed 's/^X//' << \SHAR_EOF > strnicmp.c
  938. X/*
  939. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  940. X * This code is freely redistributable as long as no charge other than
  941. X * reasonable copying fees are levied for it.
  942. X */
  943. X
  944. X#include <ctype.h>
  945. X
  946. Xint strnicmp(str1,str2,len)
  947. Xregister char *str1,*str2;
  948. Xregister int len;
  949. X{
  950. X    register int index = 0;
  951. X
  952. X    while ( str1[index] && str2[index] && index < len - 1 &&
  953. X            tolower(str1[index]) == tolower(str2[index]) )
  954. X        ++index;
  955. X
  956. X    return( (tolower(str1[index]) < tolower(str2[index])) ? -1 :
  957. X          ( (tolower(str1[index]) > tolower(str2[index])) ?  1 : 0) );
  958. X}
  959. X
  960. SHAR_EOF
  961. echo "extracting strpbrk.c"
  962. sed 's/^X//' << \SHAR_EOF > strpbrk.c
  963. X/*
  964. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  965. X * This code is freely redistributable as long as no charge other than
  966. X * reasonable copying fees are levied for it.
  967. X */
  968. X
  969. X#define NULL    0L
  970. X
  971. Xchar *strpbrk(str, charset)
  972. Xregister char *str, *charset;
  973. X{
  974. X        register char *temp;
  975. X        extern char *index();
  976. X
  977. X        temp = str;
  978. X
  979. X        while ( *temp && !index(charset, *temp) )
  980. X                temp++;
  981. X
  982. X        return( *temp ? temp : NULL);
  983. X}
  984. SHAR_EOF
  985. echo "extracting strpos.c"
  986. sed 's/^X//' << \SHAR_EOF > strpos.c
  987. X/*
  988. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  989. X * This code is freely redistributable as long as no charge other than
  990. X * reasonable copying fees are levied for it.
  991. X */
  992. X
  993. X/*
  994. X    strpos searches the null-terminated string string for the first
  995. X    occurance of the character "key". It returns either the position
  996. X    or EOF if it is not found.
  997. X*/
  998. X
  999. Xint strpos(string,key)
  1000. Xregister char *string;
  1001. Xregister char key;
  1002. X{
  1003. X    register int counter = 0;
  1004. X
  1005. X    if ( !key )
  1006. X        return(strlen(string));
  1007. X
  1008. X    while (string[counter]) {
  1009. X        if (string[counter] == key)
  1010. X            return(counter);
  1011. X        counter++;
  1012. X    }
  1013. X    return(-1);
  1014. X}
  1015. SHAR_EOF
  1016. echo "extracting strrpbrk.c"
  1017. sed 's/^X//' << \SHAR_EOF > strrpbrk.c
  1018. X/*
  1019. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  1020. X * This code is freely redistributable as long as no charge other than
  1021. X * reasonable copying fees are levied for it.
  1022. X */
  1023. X
  1024. X#define NULL    0L
  1025. X
  1026. Xchar *strrpbrk(str, charset)
  1027. Xregister char *str, *charset;
  1028. X{
  1029. X        register char *temp;
  1030. X        extern char *index();
  1031. X
  1032. X        temp = str + strlen(str) - 1;
  1033. X
  1034. X        while ( temp != (str - 1)  && !index(charset, *temp) )
  1035. X                --temp;
  1036. X
  1037. X        return( (temp != (str - 1)) ? temp : NULL);
  1038. X}
  1039. SHAR_EOF
  1040. echo "extracting strrpos.c"
  1041. sed 's/^X//' << \SHAR_EOF > strrpos.c
  1042. X/*
  1043. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  1044. X * This code is freely redistributable as long as no charge other than
  1045. X * reasonable copying fees are levied for it.
  1046. X */
  1047. X
  1048. X/*
  1049. X    strrpos searches the null-terminated string string for the last
  1050. X    occurance of the character "key". It returns either the position
  1051. X    or -1 if it is not found.
  1052. X*/
  1053. X
  1054. Xint strrpos(string,key)
  1055. Xregister char *string;
  1056. Xregister char key;
  1057. X{
  1058. X    register char *temp;
  1059. X
  1060. X    if ( !key )
  1061. X        return(strlen(string));
  1062. X
  1063. X    for (temp = string + strlen(string) - 1; temp >= string ; temp-- )
  1064. X        if ( *temp == key)
  1065. X            return(temp - string);
  1066. X
  1067. X    return(-1);
  1068. X}
  1069. SHAR_EOF
  1070. echo "extracting strspn.c"
  1071. sed 's/^X//' << \SHAR_EOF > strspn.c
  1072. X/*
  1073. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  1074. X * This code is freely redistributable as long as no charge other than
  1075. X * reasonable copying fees are levied for it.
  1076. X */
  1077. X
  1078. X/* Return the number of characters from "charset" that are at the BEGINNING
  1079. X * of string "str".
  1080. X*/
  1081. X
  1082. Xint strspn(str, charset)
  1083. Xregister char *str, *charset;
  1084. X{
  1085. X        register char *temp = str;
  1086. X
  1087. X        while ( index(charset, *temp) )
  1088. X                ++temp;
  1089. X
  1090. X        return(temp - str);
  1091. X}
  1092. SHAR_EOF
  1093. echo "extracting strtod.c"
  1094. sed 's/^X//' << \SHAR_EOF > strtod.c
  1095. X/*
  1096. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  1097. X * This code is freely redistributable as long as no charge other than
  1098. X * reasonable copying fees are levied for it.
  1099. X */
  1100. X
  1101. X
  1102. X/*  File   : strtod.c
  1103. X    Author : Richard A. O'Keefe @ Quintus Computer Systems, Inc.
  1104. X    Updated: Saturday March 11, 1989
  1105. X    Defines: double strtod(char *str, char**ptr)
  1106. X*/
  1107. X
  1108. X/*  This is an implementation of the strtod() function described in the
  1109. X    System V manuals, with a different name to avoid linker problems.
  1110. X    All that str2dbl() does itself is check that the argument is well-formed
  1111. X    and is in range.  It leaves the work of conversion to atof(), which is
  1112. X    assumed to exist and deliver correct results (if they can be represented).
  1113. X
  1114. X    There are two reasons why this should be provided to the net:
  1115. X    (a) some UNIX systems do not yet have strtod(), or do not have it
  1116. X        available in the BSD "universe" (but they do have atof()).
  1117. X    (b) some of the UNIX systems that *do* have it get it wrong.
  1118. X        (some crash with large arguments, some assign the wrong *ptr value).
  1119. X    There is a reason why *we* are providing it: we need a correct version
  1120. X    of strtod(), and if we give this one away maybe someone will look for
  1121. X    mistakes in it and fix them for us (:-).
  1122. X*/
  1123. X
  1124. X/*  The following constants are machine-specific.  MD{MIN,MAX}EXPT are
  1125. X    integers and MD{MIN,MAX}FRAC are strings such that
  1126. X        0.${MDMAXFRAC}e${MDMAXEXPT} is the largest representable double,
  1127. X        0.${MDMINFRAC}e${MDMINEXPT} is the smallest representable +ve double
  1128. X    MD{MIN,MAX}FRAC must not have any trailing zeros.
  1129. X    The values here are for IEEE-754 64-bit floats.
  1130. X    It is not perfectly clear to me whether an IEEE infinity should be
  1131. X    returned for overflow, nor what a portable way of writing one is,
  1132. X    so HUGE is just 0.MAXFRAC*10**MAXEXPT (this seems still to be the
  1133. X    UNIX convention).
  1134. X
  1135. X    I do know about <values.h>, but the whole point of this file is that
  1136. X    we can't always trust that stuff to be there or to be correct.
  1137. X*/
  1138. X
  1139. Xextern  double  atof();         /* Only called when result known to be ok */
  1140. X
  1141. X#include "edlib.h"
  1142. X#include <ctype.h>
  1143. X#include <errno.h>
  1144. Xextern  int     errno;
  1145. X
  1146. Xdouble strtod(str, ptr)
  1147. Xchar *str;
  1148. Xchar **ptr;
  1149. X{
  1150. X  int sign, scale, dotseen;
  1151. X  int esign, expt;
  1152. X  char *save;
  1153. X  register char *sp, *dp;
  1154. X  register int c;
  1155. X  char *buforg, *buflim;
  1156. X  char buffer[64];                /* 45-digit significand + */
  1157. X                                  /* 13-digit exponent */
  1158. X  sp = str;
  1159. X  while (*sp == ' ')
  1160. X    sp++;
  1161. X
  1162. X  sign = 1;
  1163. X
  1164. X  if (*sp == '-') {
  1165. X    sign -= 2;
  1166. X    sp++;
  1167. X  }
  1168. X
  1169. X  dotseen = 0;
  1170. X  scale = 0;
  1171. X  dp = buffer;
  1172. X
  1173. X  *dp++ = '0';
  1174. X  *dp++ = '.';
  1175. X
  1176. X  buforg = dp;
  1177. X  buflim = buffer+48;
  1178. X
  1179. X  for (save = sp; c = *sp; sp++) {
  1180. X
  1181. X    if (c == '.') {
  1182. X
  1183. X      if (dotseen)
  1184. X        break;
  1185. X
  1186. X      dotseen++;
  1187. X
  1188. X    } else if ( !isdigit(c) ) {
  1189. X      break;
  1190. X
  1191. X    } else if (c == '0') {
  1192. X
  1193. X      if (dp != buforg) {
  1194. X
  1195. X        /* This is not the first digit, so we want to keep it */
  1196. X        if (dp < buflim) {
  1197. X          *dp++ = c;
  1198. X          scale += 1;
  1199. X        }
  1200. X
  1201. X      } else {
  1202. X
  1203. X        /* No non-zero digits seen yet */
  1204. X        /* If a . has been seen, scale must be adjusted */
  1205. X        if (dotseen)
  1206. X          scale--;
  1207. X      }
  1208. X    } else {
  1209. X
  1210. X      /* This is a nonzero digit, so we want to keep it */
  1211. X      if (dp < buflim)
  1212. X        *dp++ = c;
  1213. X
  1214. X      /* If it precedes a ., scale must be adjusted */
  1215. X      if (!dotseen)
  1216. X        scale++;
  1217. X    }
  1218. X  }
  1219. X  if (sp == save) {
  1220. X    if (ptr)
  1221. X      *ptr = str;
  1222. X    errno = EDOM;               /* what should this be? */
  1223. X    return ZERO;
  1224. X  }
  1225. X
  1226. X  while (dp > buforg && dp[-1] == '0')
  1227. X    --dp;
  1228. X
  1229. X  if (dp == buforg)
  1230. X    *dp++ = '0';
  1231. X
  1232. X  *dp = '\0';
  1233. X
  1234. X  /*  Now the contents of buffer are
  1235. X      +--+--------+-+--------+
  1236. X      |0.|fraction|\|leftover|
  1237. X      +--+--------+-+--------+
  1238. X                   ^dp points here
  1239. X      where fraction begins with 0 iff it is "0", and has at most
  1240. X      45 digits in it, and leftover is at least 16 characters.
  1241. X  */
  1242. X
  1243. X  save = sp;
  1244. X  expt = 0;
  1245. X  esign = 1;
  1246. X
  1247. X  do {
  1248. X    c = *sp++;
  1249. X
  1250. X    if (c != 'e' && c != 'E')
  1251. X      break;
  1252. X
  1253. X    c = *sp++;
  1254. X
  1255. X    if ( c == '-' ) {
  1256. X      esign -= 2;
  1257. X      c = *sp++;
  1258. X    } else if (c == '+' || c == ' ') {
  1259. X      c = *sp++;
  1260. X    }
  1261. X
  1262. X    if ( !isdigit(c) )
  1263. X      break;
  1264. X
  1265. X    while (c == '0')
  1266. X      c = *sp++;
  1267. X
  1268. X    for (; isdigit(c); c = *sp++)
  1269. X      expt = expt*10 + toint(c);
  1270. X
  1271. X    if (esign < 0)
  1272. X      expt = -expt;
  1273. X
  1274. X    save = sp-1;
  1275. X
  1276. X  } while (0);
  1277. X
  1278. X  if (ptr)
  1279. X    *ptr = save;
  1280. X
  1281. X  expt += scale;
  1282. X
  1283. X  /*  Now the number is sign*0.fraction*10**expt  */
  1284. X  errno = ERANGE;
  1285. X
  1286. X  if (expt > MDMAXEXPT) {
  1287. X    return(HUGE*sign);
  1288. X  } else if (expt == MDMAXEXPT) {
  1289. X    if (strcmp(buforg, MDMAXFRAC) > 0)
  1290. X      return(HUGE*sign);
  1291. X  } else if (expt < MDMINEXPT) {
  1292. X    return(ZERO*sign);
  1293. X  } else if (expt == MDMINEXPT) {
  1294. X    if (strcmp(buforg, MDMINFRAC) < 0)
  1295. X      return(ZERO*sign);
  1296. X  }
  1297. X
  1298. X  /*  We have now established that the number can be  */
  1299. X  /*  represented without overflow or underflow  */
  1300. X  (void) sprintf(dp, "e%d", expt);
  1301. X  errno = 0;
  1302. X  return(atof(buffer)*sign);
  1303. X}
  1304. X
  1305. SHAR_EOF
  1306. echo "extracting strtok.c"
  1307. sed 's/^X//' << \SHAR_EOF > strtok.c
  1308. X/*
  1309. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  1310. X * This code is freely redistributable as long as no charge other than
  1311. X * reasonable copying fees are levied for it.
  1312. X */
  1313. X
  1314. X#define STRING_END      '\0'
  1315. X#ifndef NULL
  1316. X#define NULL    0L
  1317. X#endif
  1318. X
  1319. Xchar *strtok(buf, separators)
  1320. Xregister char *buf, *separators;
  1321. X{
  1322. X        register char *token, *end;     /* Start and end of token. */
  1323. X        extern char *strpbrk();
  1324. X        static char *fromLastTime;
  1325. X
  1326. X        if (token = buf ? buf : fromLastTime) {
  1327. X                token += strspn(token, separators);     /* Find token! */
  1328. X                if (*token == STRING_END)
  1329. X                        return(NULL);
  1330. X                fromLastTime = ((end = strpbrk(token,separators))
  1331. X                                ? &end[1]
  1332. X                                : NULL);
  1333. X                *end = STRING_END;                      /* Cut it short! */
  1334. X        }
  1335. X        return(token);
  1336. X}
  1337. SHAR_EOF
  1338. echo "extracting test.c"
  1339. sed 's/^X//' << \SHAR_EOF > test.c
  1340. X/*
  1341. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  1342. X * This code is freely redistributable as long as no charge other than
  1343. X * reasonable copying fees are levied for it.
  1344. X */
  1345. X
  1346. X#include <stdio.h>
  1347. X#include "edlib.h"
  1348. X#include <ctype.h>
  1349. X#include <exec/types.h>
  1350. X
  1351. Xchar *b = "10101";
  1352. Xchar *d = "12345";
  1353. Xchar *h = "2a";
  1354. Xchar *zoo = "ifoo";
  1355. Xchar *zar = "Ibar";
  1356. X
  1357. Xchar *s1 = "hey man this was in lower case.";
  1358. Xchar *s2 = "THIS WAS ENTIRELY UPPER CASE IN THE FASHION OF IBM.";
  1359. X
  1360. Xchar *s3 = "hey man this was in lower case.";
  1361. Xchar *s4 = "THIS WAS ENTIRELY UPPER CASE IN THE FASHION OF IBM.";
  1362. X
  1363. Xchar *file = "df1:edlib/1.1";
  1364. Xchar *file2 = "df0:foo";
  1365. Xchar *file3 = "foobar";
  1366. Xchar *file4 = "rad:c";
  1367. Xchar *file5 = "rad:edlib";
  1368. Xchar *doub = "00011020.332e+20";
  1369. X
  1370. Xmain()
  1371. X{
  1372. X    char buf[BUFSIZ];
  1373. X
  1374. X    printf("basename of %s is %s\n",file,basename(file));
  1375. X    printf("basename of %s is %s\n",file2,basename(file2));
  1376. X    printf("basename of %s is %s\n",file3,basename(file3));
  1377. X
  1378. X    printf("getcwd reveals that the current dir is %s\n",getcwd(buf,BUFSIZ));
  1379. X    printf("getcwd reveals again that the current dir is %s\n",getcwd(buf,BUFSIZ));
  1380. X    printf("and changing directory to %s and then %s\n",file4,file5);
  1381. X    chdir(file4);
  1382. X    chdir(file5);
  1383. X    printf("getcwd reveals that the current dir is %s\n",getcwd(buf,BUFSIZ));
  1384. X
  1385. X    printf("strtod of %s is %f\n",doub,strtod(doub,NULL));
  1386. X
  1387. X    printf("Bin: %d\n",bintoint(b));
  1388. X    printf("Dec: %d\n",dectoint(d));
  1389. X    printf("Hex: %d\n",hextoint(h));
  1390. X
  1391. X    printf("Is 1 a bdigit? %d Is 'a'? %d\n",isbdigit('1'),isbdigit('a'));
  1392. X
  1393. X    printf("iscsym: 'a' %d '_' %d '4' %d '!' %d '/' %d\n",iscsym('a'),
  1394. X            iscsym('_'), iscsym('4'), iscsym('!'), iscsym('/'));
  1395. X
  1396. X    printf("iscsymf: 'a' %d '_' %d '4' %d '!' %d '/' %d\n",iscsymf('a'),
  1397. X            iscsymf('_'), iscsymf('4'), iscsymf('!'), iscsymf('/'));
  1398. X
  1399. X    printf("isodigit: '2' %d '8' %d 'a' %d\n", isodigit('2'), isodigit('8'),
  1400. X            isodigit('a'));
  1401. X
  1402. X    printf("stoupper: %s\n",stoupper(s1));
  1403. X    printf("stolower: %s\n",stolower(s2));
  1404. X
  1405. X    printf("strcspn: '%s' '%s' gives %d\n",s3,"an",strcspn(s3,"an"));
  1406. X
  1407. X    printf("stricmp: '%s' '%s' gives %d\n",s1,s3,stricmp(s1,s3));
  1408. X    printf("strnicmp: '%s' '%s' 1 gives %d\n",zoo,zar,strnicmp(zoo,zar,1));
  1409. X
  1410. X    printf("strpbrk: '%s' '%s' gives '%s'\n",s3,"a",strpbrk(s3,"a"));
  1411. X
  1412. X    printf("strpos: '%s' '%c' gives %d\n",s3,'a',strpos(s3,'a'));
  1413. X
  1414. X    printf("strrpbrk: '%s' '%s' gives '%s'\n",s3,"a",strrpbrk(s3,"a"));
  1415. X
  1416. X    printf("strrpos: '%s' '%s' gives %d\n",s3,'a',strrpos(s3,'a'));
  1417. X
  1418. X    printf("strspn: '%s' '%s' gives %d\n",s3,"ma yeh",strspn(s3,"ma yeh"));
  1419. X
  1420. X    printf("strtok: '%s'\n",s3);
  1421. X    printf("  tok1: '%s'\n",strtok(s3," "));
  1422. X    printf("  tok2: '%s'\n",strtok(NULL," "));
  1423. X    printf("  tok3: '%s'\n",strtok(NULL," "));
  1424. X
  1425. X    printf("toint: '1' %d 'b' %d 'k' %d\n",toint('1'),toint('b'),toint('k'));
  1426. X
  1427. X    exit(0);
  1428. X}
  1429. X
  1430. X
  1431. X
  1432. X
  1433. SHAR_EOF
  1434. echo "extracting toint.c"
  1435. sed 's/^X//' << \SHAR_EOF > toint.c
  1436. X/*
  1437. X * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  1438. X * This code is freely redistributable as long as no charge other than
  1439. X * reasonable copying fees are levied for it.
  1440. X */
  1441. X
  1442. X/*
  1443. X    toint is also not included in Manx. converts an ascii character
  1444. X    into its corresponding hexadecimal value. Can be used for
  1445. X    binary and decimal digits since these are subsets of the
  1446. X    hexadecimal character set.
  1447. X*/
  1448. Xint toint(c)
  1449. Xregister char c;
  1450. X{
  1451. X    if ( c >= '0' && c <= '9') {
  1452. X        return( c - '0' );
  1453. X    } else if ( c >= 'a' && c <= 'f' ) {
  1454. X        return( c - 'a' + 10 );
  1455. X    } else if ( c >= 'A' && c <= 'F' ) {
  1456. X        return( c - 'A' + 10 );
  1457. X    } else
  1458. X        return(-1);
  1459. X}
  1460. SHAR_EOF
  1461. echo "End of archive 2 (of 2)"
  1462. # if you want to concatenate archives, remove anything after this line
  1463. exit
  1464.